import { PointIndex } from '@/geom/geo-index'
import type { Waypoint } from './types'

export let waypointIndex: PointIndex<Waypoint>

export function initWaypointIndex(wptLst: Waypoint[]) {
  waypointIndex = new PointIndex({
    data: wptLst,
    getX: (e) => e.location.lng,
    getY: (e) => e.location.lat
  })
}
